<template>
	<view class="content">
		<view class="c2c">
			<view class="block">
				<view class="left">
					<text>合约单位设置</text>
				</view>
				<view class="right">
				<picker @change="set1" :value="coinType" :range="coinList">
					<view class="flex">
						<view class="uni-inputs" style="color: #A4A4A4;">
						{{ coinList[coinType] }}
						<uni-icons type="arrowright" :color="'#A4A4A4'" size="16"></uni-icons>
						</view>
						<view class="triangle"></view>
					</view>
				</picker>
				</view>
			</view>
			<view class="block">
				<view class="left">
					<text>限价委托下单确认</text>
				</view>
				<view class="right">
					<switch :checked="price ? true : false" style="transform: scale(0.5);margin-right: -26rpx;margin-bottom: 16rpx;" @change="switch1Change" />
				</view>
			</view>
			<view class="block">
				<view class="left">
					<text>计划委托下单确认</text>
				</view>
				<view class="right">
					<switch :checked="plan ? true : false" style="transform: scale(0.5);margin-right: -26rpx;margin-bottom: 16rpx;" @change="switch2Change" />
				</view>
			</view>
		</view>
		<!-- 确认 -->
		<Modal v-if="showOut" :title="'开启委托确认'" @close="closeModal()">
			<view class="msg_model">
				<view class="block4">是否开启委托下单确认？</view>
				<view class="subto">
					<view class="no" @click="closeModal()">
						取消
					</view>
					<view class="yes">
						确认开启
					</view>
				</view>
			</view>
		</Modal>
	</view>
</template>

<script>
import uniIcons from '@/components/uni-icon/uni-icon.vue';
import Modal from '@/components/msg-modal/index.vue';
export default {
	components: { uniIcons, Modal },
	data() {
		return {
			showOut: false,
			price: false,
			plan: false,
			coinType: 0,
			coinList: ["张","手"],
		};
	},
	computed: {},
	onShow() {},
	methods: {
		closeModal() {
			this.showOut = false;
		},
		//选择1
		set1(e) {
			this.coinType = e.target.value;
		},
		switch1Change: function(e) {
			if(e.target.value) {
				this.showOut = true;
			}
		},
		switch2Change: function(e) {
			if(e.target.value) {
				this.showOut = true;
			}
		},
	}
};
</script>

<style lang="scss" scoped>
@import './style.scss';
</style>
